package com.iiiss.template.ssh.impl.beans;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.ManyToMany;

import com.iiiss.template.ssh.core.beans.ISnsUser;

/*
 * TemplateSSH - com.iiiss.template.ssh.impl.beans - SnsUser.java
 * 
 * Copyright (C) 2011  Mingye Cheng <Cheng, Mingye at GMAIL>
 * 
 * SnsUser.java is part of <iiiStudio Template Framework> project.
 * This project is hosted at <http://iiiss-template-ssh.googlecode.com>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Revision history:
 * [2011-8-9] Mingye Cheng - Initial version established.
 */
@Entity
public class SnsUser extends User implements ISnsUser {
	@ManyToMany(targetEntity = SnsUser.class, mappedBy = "followers")
	private List<ISnsUser> friends = new ArrayList<ISnsUser>();

	@ManyToMany(targetEntity = SnsUser.class)
	private List<ISnsUser> followers = new ArrayList<ISnsUser>();

	public List<ISnsUser> getFriends() {
		return friends;
	}

	public void setFriends(List<ISnsUser> friends) {
		this.friends = friends;
	}

	public List<ISnsUser> getFollowers() {
		return followers;
	}

	public void setFollowers(List<ISnsUser> followers) {
		this.followers = followers;
	}
}
